package com.cloudfun.campusshare.repo;

import com.cloudfun.campusshare.entity.AuthPersonEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

/**
 * @Author : linyangping
 * @Date : Created in 1:54 PM 2019/11/6
 */
public interface AuthPersonEntityRepo extends
        PagingAndSortingRepository<AuthPersonEntity, String>,
        JpaSpecificationExecutor<AuthPersonEntity> {

    @Query(value = "select * from `auth_person` where user_id = :user_id", nativeQuery = true)
    AuthPersonEntity findbyUserId(@Param("user_id") String user_id);
}